//
//  HGMvTableViewCell.m
//  悦享
//
//  Created by dllo on 16/3/28.
//  Copyright © 2016年 张洪国. All rights reserved.
//

#import "HGMvTableViewCell.h"
#import "SongModel.h"
#import <UIImageView+WebCache.h>
#import "SongMVModel.h"
@implementation HGMvTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubView];
    }
    return self;
}

- (void)createSubView{
    
    self.image1 = [[UIImageView alloc] init];
    [self.contentView addSubview:_image1];
    
    self.nameLabel = [[UILabel alloc] init];
    [self.contentView addSubview:_nameLabel];
    
    self.singerLabel = [[UILabel alloc] init];
    [self.contentView addSubview:_singerLabel];
}


- (void)setModel:(SongModel *)model{
    
    _model = model;
    
    SongMVModel *model1 = [_model.mvListArr lastObject];
    
    
    [_image1 sd_setImageWithURL:[NSURL URLWithString:model1.picUrl] placeholderImage:[UIImage imageNamed:@"place"]];
    _nameLabel.text = _model.videoName;
    _singerLabel.text = _model.singerName;
    
    
}

- (void)layoutSubviews{
    [super layoutSubviews];
    
    
    
    _image1.frame = CGRectMake(5, 5, self.contentView.frame.size.width / 3 + 20, self.contentView.frame.size.height - 10);
    
    _nameLabel.frame = CGRectMake(self.contentView.frame.size.width / 3 + 20 + 15, 15, self.contentView.frame.size.width / 3, 30);
    
    
    _nameLabel.font = [UIFont systemFontOfSize:15];
    _singerLabel.frame = CGRectMake(self.contentView.frame.size.width / 3 + 20 + 15, 45, 50, 30);
    _singerLabel.font = [UIFont systemFontOfSize:12];
    
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
